<?php
class Cts_Encode
{
    public static function encode($value)
	{
		$encode = new self();
		return $encode->_encodeArray($value);
	}
	
	protected function _encodeArray($value)
	{
        if(is_array($value))
        {
            foreach($value as $k => $v)
            {
                $value[$k] = $this->_encodeArray($value[$k]);
            }
        }
        else
        {
            $value = mb_convert_encoding($value,"UTF-8", "gb2312");
        }

		return $value;
	}
}